// https://www.luogu.com.cn/problem/B3634

#include <stdio.h>
#include <algorithm>
using namespace std;

int gcd(int a, int b) {
    return b == 0 ? a : gcd(b, a % b);
}

int main() {
    long long m, n;
    scanf("%lld%lld", &m, &n);
    if (m < n) swap(m, n);
    long long c = gcd(m, n);
    long long d = m / c * n;
    printf("%lld %lld", c, d);
    return 0;
}
